interface paymentType {
    items: Array<itemType>
    orderId?: number
    sn?: string
    payment:string
    studentId:number,
    telephone:string,
    userName:string
}
interface itemType {
  courseId?: number
  courseSerialCover?: string
  courseSerialId: number,
  courseSerialName?: string,
  discountAmount?: number,
  instructoId?:number,
  instructorUsername?: string,
  lessonCount?: number,
  price?: number
}
import http from '../utils/http'
// 获取我的课程列表
export const getMyCourseList = (data:{pageNum?:number,pageSize?:number,stuId?:number})=>{
  return http({
    method:"GET",
    url:`/user/course/myCourseList`,
    data
  })
}
// 我的课程详情
export const MyCourseDetail = (data:{serialId?:number,stuId?:number})=>{
  return http({
    method:"GET",
    url:`/user/course/courseDetail`,
    data
  })
}
//获取历史课程
export const getHistoryCourse = (data:{endDate?:string,pageNum?:number,pageSize?:number,startDate?:string,stuId?:number})=>{
  return http({
    method:"GET",
    url:`/user/course/historyCourseList`,
    data
  })
}
//获取系列课程
export const getSeriesCourse = (data:{courseId:number,excludeSeriesId?:number,stuId?:number})=>{
  return http({
    method:"GET",
    url:`/user/course/seriesList`,
    data
  })
}
// 支付接口
export const payment = (data:paymentType)=>{
  return http({
    method:"POST",
    url:`/user/pay/coursePurchases`,
    data
  })
}
// 支付回调接口
export const paymentCallback = (data:{orderNumber:string,transactionId:string})=>{
  return http({
    method:"POST",
    url:`/user/pay/testcourseNotify`,
    data
  })  
}
//获取购买记录
export const getPurchaseHistory = (data:{
  month:string,
  pageNum?:number,
  pageSize?:number
})=>{
  return http({
    method:"GET",
    url:`/user/order/list`,
    data
  })  
}
// 请假申请

export const leaveDateApply = (data:{
  lessonIds:Array<number>,
  reason:string,
  stuId:number
})=>{
  return http({
    method:"POST",
    url:`/user/leave/apply`,
    data
  })  
}
